package com.star.mybatisplusgenerrator.controller;


import com.star.mybatisplusgenerrator.mapper.UserMapper;
import com.star.mybatisplusgenerrator.model.User;
import com.star.mybatisplusgenerrator.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author star
 * @since 2021-12-27
 */
@RestController
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserMapper userMapper;

    @Autowired
    private IUserService userService;

    @GetMapping("/all")
    public List<User> all(){
       // return userMapper.selectList(null);
       return userService.list();
    }
}
